/**mockApi说明：
 * method默认值是post
 * isMock默认值是false，即默认不拦截
 * code默认值是'200'
 * data: 可以是对象
 *       也可以是方法，通过参数返回不同的数据
 */
import {
    host,
    successCode,
} from '@/apis/client/paymentClient'
// 不需要提示为mock获取的数据的api
const notNeedMessageTip = [];

const drpCurrencyValues = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];
const mockApiData = {
    '/getPaymentApplicationFormQueryData': {
        method: 'get', //TODO 此处配置get请求是为了测试mock拦截get的传参
        isMock: true,
        data: {
            "data|10": [{
                "payway|+1": ['1', '2', '3'],
                "capitalallocationbillno": "@word()" + "@integer(1, 100)" + parseInt(Math.random() * 9999) + "6000" + Math.random() * 10,
                "summaryno": "ZB2" + parseInt(Math.random() * 9999) + "8150018" + parseInt(Math.random() * 10),
                "exchangecurrencycode|+1": drpCurrencyValues,
                "exchangeamount": (Math.random() * 50000).toFixed(2),
                "currencycode|+1": drpCurrencyValues,
                "amount": (Math.random() * 50000).toFixed(2),
                "operatetime": "@date",
                "customercode": "ICHN034" + parseInt(Math.random() * 10),
                "customername": '@cname',
                "paymentstatus|+1": ['6', '7', '10'],
                "operratorname": '@cname',
                "fastflag|+1": ['0', '1'],
                "tabperiod": "@date",
                "memo": '@cword(5,10)',
                "paymenttime": "@date",
                "in_amount": (Math.random() * 5000).toFixed(2),
                "in_currency|+1": drpCurrencyValues,
                "paymentmode|+1": ['1', '2'],
                "visible": "@boolean()",
                "collpayflag|+1": ['0', '1'],
                "accountno": parseInt(Math.random() * 9999) + "8150018" + parseInt(Math.random() * 10),
                "backinfo": '@cword(5,10)',
                "viewPDF": "查看PDF",
                "accountname": '@cword(9, 12)公司',
                "inpaymentmethod|+1": ['2'], //['1', '2'],
                "custaccountno": (Math.random() * 50000).toFixed(0) + "@word()" + "@integer(1, 100)",
                "custbankno": parseInt((Math.random() * 50000)),
                "bankname|+1": ['农业银行', '招商银行', '邮政银行'],
                "bankprovince": '@province',
                "bankcity": '@city',
                "exchangeflag|+1": ['1', '0'],
                "exchangerate": (Math.random() * 10).toFixed(2),
                "bankaccountno": "@word()" + "@integer(1, 100)" + parseInt(Math.random() * 9999) + "6000" + Math.random() * 10,
            }, ]
        }
    },
    '/paymentApplicationFormInfo': {
        method: 'post',
        isMock: true,
        data: {
            "data|10": [{
                "ribillno": "@word()" + "@integer(1, 100)" + parseInt(Math.random() * 9999) + "6000" + Math.random() * 10,
                "basecurrency|+1": drpCurrencyValues,
                "sumorireceiveamount": (Math.random() * 50000).toFixed(2),
                "sumoripayamount": (Math.random() * 50000).toFixed(2),
                "orireceiveamount": (Math.random() * 50000).toFixed(2),
                "oripayamount": (Math.random() * 50000).toFixed(2),
                "taxesamount": (Math.random() * 5000).toFixed(2),
                "vatsurcharge": (Math.random() * 500).toFixed(2),
                "taxescnyamount": (Math.random() * 500).toFixed(2),
                "vatsurchargermb": (Math.random() * 500).toFixed(2),
                "reinsurernamecn": "@cname",
                "operratorname": "@cname",
                "posteddate": '@date',
                "memo": '@cword(5,10)',
                "opttype|+1": ['0', '1'],
                "currency|+1": drpCurrencyValues,
                "sumreceiveamount": (Math.random() * 50000).toFixed(2),
                "sumpayamount": (Math.random() * 50000).toFixed(2),
                "receiveamount": (Math.random() * 50000).toFixed(2),
                "payamount": (Math.random() * 50000).toFixed(2),
            }, ]
        }
    },
    '/submitBankCompany': {
        method: 'post',
        isMock: true,
        data: null
    },
    '/paymentApplicationForm': {
        method: 'post',
        isMock: true,
        data: null
    },
    '/getPaymentViewPDF': {
        method: 'post',
        isMock: true,
        data: null
    },
    '/submitPaymentApplicationFormData': {
        method: 'post',
        isMock: true,
        data: null
    },
    '/exportFile': {
        method: 'post',
        isMock: true,
        data: null
    },
    '/getDownPaymentFile': {
        method: 'post',
        isMock: true,
        data: null
    }
}

export {
    host,
    successCode,
    notNeedMessageTip,
    mockApiData,
};